/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package EA_Model.IEC61970.Wires.impl;

import EA_Model.IEC61970.Wires.RatioTapChanger;
import EA_Model.IEC61970.Wires.TransformerControlMode;
import EA_Model.IEC61970.Wires.WiresPackage;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Ratio Tap Changer</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link EA_Model.IEC61970.Wires.impl.RatioTapChangerImpl#getTculControlMode <em>Tcul Control Mode</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class RatioTapChangerImpl extends TapChangerImpl implements RatioTapChanger {
	/**
	 * The default value of the '{@link #getTculControlMode() <em>Tcul Control Mode</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTculControlMode()
	 * @generated
	 * @ordered
	 */
	protected static final TransformerControlMode TCUL_CONTROL_MODE_EDEFAULT = TransformerControlMode.VOLT;

	/**
	 * The cached value of the '{@link #getTculControlMode() <em>Tcul Control Mode</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTculControlMode()
	 * @generated
	 * @ordered
	 */
	protected TransformerControlMode tculControlMode = TCUL_CONTROL_MODE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected RatioTapChangerImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return WiresPackage.Literals.RATIO_TAP_CHANGER;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TransformerControlMode getTculControlMode() {
		return tculControlMode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTculControlMode(TransformerControlMode newTculControlMode) {
		TransformerControlMode oldTculControlMode = tculControlMode;
		tculControlMode = newTculControlMode == null ? TCUL_CONTROL_MODE_EDEFAULT : newTculControlMode;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, WiresPackage.RATIO_TAP_CHANGER__TCUL_CONTROL_MODE, oldTculControlMode, tculControlMode));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case WiresPackage.RATIO_TAP_CHANGER__TCUL_CONTROL_MODE:
				return getTculControlMode();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case WiresPackage.RATIO_TAP_CHANGER__TCUL_CONTROL_MODE:
				setTculControlMode((TransformerControlMode)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case WiresPackage.RATIO_TAP_CHANGER__TCUL_CONTROL_MODE:
				setTculControlMode(TCUL_CONTROL_MODE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case WiresPackage.RATIO_TAP_CHANGER__TCUL_CONTROL_MODE:
				return tculControlMode != TCUL_CONTROL_MODE_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (tculControlMode: ");
		result.append(tculControlMode);
		result.append(')');
		return result.toString();
	}

} //RatioTapChangerImpl
